package mz.mobileservices.mcel;

import mz.mobileservices.uem.R;
import mz.mobileservices.uem.SendSMS;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Factura extends Activity
{
	Button btnSendSMS, btnCancel;
	EditText txtNum;
	
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.factura);
        
        btnSendSMS = (Button) findViewById(R.id.btnSendSMS);
        btnCancel = (Button) findViewById(R.id.btnCancel);
        txtNum = (EditText) findViewById(R.id.txtPinNo);
    
        btnCancel.setOnClickListener (new View.OnClickListener() 
        {	
			public void onClick(View v) 
			{
				finish();	
			}
		});
        
        btnSendSMS.setOnClickListener(new View.OnClickListener() 
        {
            public void onClick(View v) 
            {               
            	String num =  txtNum.getText().toString();
                      
                if (num.length()==0)
                {
                	Toast.makeText(getBaseContext(), "Por favor insera o numero do cliente.", Toast.LENGTH_LONG).show(); 
                }	
                
                else	
                {
                	String message = "agua"+" "+num;    
                	Intent i = new Intent(getApplicationContext(),SendSMS.class);
               	 	i.putExtra("numero","822424");
               	 	i.putExtra("comando",message);
               	 	
               	 	startActivity(i);
               	 	finish();
                }	
            }
        });        
    }
}
